using System.Web;
using System.Web.SessionState;

namespace WebLogic.Models
{
    public class SessionHelper
    {
        private HttpSessionState session;
        private const string VariableName = "LoggedIn";

        public SessionHelper()
        {
            this.session = HttpContext.Current.Session;
        }
        public bool LoggedIn()
        {
            if (session!=null)
                return (bool) (session[VariableName]??false);
            return false;
        }

        public void LogIn()
        {
            session[VariableName] = true;
        }

        public void LogOff()
        {
            session[VariableName] = false;
        }
    }
}